<ion-view view-title="确认订单" class="afsrue">
	<!--一定要手动加导航栏-->
	<ion-nav-bar>
		<ion-nav-back-button>
		</ion-nav-back-button>
	</ion-nav-bar>
	<ion-content class="bg has-header has-footer">
		<div class="list" style="margin-bottom: 10px;">
			<li class="item receiverItem item-text-wrap" on-tap="openModal_delivery()">
				<div class="row item-input padding-0">
					<div class="imgCol">
						<img src="./img/guilin/other/icon_address@3x.png" />
					</div>
					<div class="col padding-0 textCol">
						<p>收货人：{{receiver.ship_name}}<span class="right-zhang">{{receiver.ship_mobile}}</span></p>
						<p style="font-size: 12px;">收货地址：{{receiver.ship_addr_area}}&nbsp;&nbsp;{{receiver.ship_addr}}</p>
					</div>
					<div class="jtCol" ng-if="check.delivery.length>1">
						<img src="./img/guilin/common/icon_right@2x.png" />
					</div>
				</div>
			</li>
			<li class="item receiverImgItem">
				<img src="./img/guilin/other/icon_fg@3x.png" width="100%" />
			</li>
			
			<!--店铺-->
			<li class="item item-input storeItem" ng-repeat-start="order_items in check.order_items" ng-init="storeIndex=$index">
				<img src="./img/guilin/common/icon_shop@2x.png" class="check" />
				{{order_items.store_name}}
				<!--<img src="./img/guilin/common/icon_right@2x.png" class="jt" />-->
			</li>
			
			<!--商品-->
			<div ng-repeat="order in order_items.slips" ng-repeat-end="order_items"><!--最外层循环结束-->
				<!--主商品-->
				<li class="item goodsItem" ng-repeat-start="items in order.items">
					<div class="row">
						<div class="imgCol">
							<img src="{{items.image}}">
						</div>
						<div class="col goodsCol">
							<div class="name ellipsis-2">{{items.goods_name}}</div>
							<div class="spec ellipsis-2">{{items.spec_info}}</div>
							<div class="price">
								{{items.price|currency:'￥'}}
								<span class="num">x{{items.num}}</span>
							</div>
						</div>
					</div>
				</li>
				
				<!--普通商品才可以设置发票-->
				<li class="item fpItem" on-tap="openModal_invoice(items)" ng-if="type==''||type=='goods'">
					发票<img src="./img/guilin/common/icon_note@2x.png" class="i" ng-if="!check.vatinfo" on-tap="showTipInfo($event)"/>
					<img src="./img/guilin/common/icon_right@2x.png" class="jt" />
					<span class="right-zhang">{{items.invoice_name?items.invoice_name:"不开发票"}}</span>
				</li>
				
				<!--主商品里的配件-->
				<li class="item goodsItem pjItem" ng-repeat="adjunct in items.adjunct" ng-repeat-end="items"><!--商品循环结束-->
					<div class="row" ng-class="{'noBorder':!$first}">
						<div class="imgCol" ng-class="{'noBorder':$parent.$last&&$last}"><!--每个店铺的最后一个商品的最后一个配件没有线-->
							<img src="{{adjunct.image}}">
						</div>
						<div class="col goodsCol" ng-class="{'noBorder':$parent.$last&&$last}">
							<div class="name ellipsis-2"><span style="color: rgb(254, 97, 25);">[配件]</span>{{adjunct.goods_name}}</div>
							<div class="spec ellipsis-2">{{adjunct.spec_info}}</div>
							<div class="price">
								{{adjunct.price|currency:'￥'}}
								<span class="num">x{{adjunct.num}}</span>
							</div>
						</div>
					</div>
				</li>
				<li class="item proItem" ng-if="order_items.store_promotion">
					<div class="row padding-0">
						<div class="col padding-0">
							店铺优惠
						</div>
						<div class="col padding-0 text-right" on-tap="showMoreProInfo()">
							<div ng-repeat="pro in order_items.store_promotion" ng-if="$index<3||isMoreProInfo">
								<span class="pro" ng-class="{'noPadding':$index==2}">{{pro.name}}</span>
								<img src="{{$index==2&&!isMoreProInfo?'./img/guilin/common/icon_down@2x.png':'./img/guilin/common/icon_up@2x.png'}}" class="showMoreJt" ng-if="$index==2"/>
							</div>
						</div>
					</div>
				</li>
				
				
				<li class="item yhItem" on-tap="openModal_coupon(storeIndex)" ng-if="order_items.coupon&&(type==''||type=='goods')">
					优惠券<img src="./img/guilin/common/icon_right@2x.png" class="jt" />
					<div class="rightDiv">
						{{order_items.cpns_name}}
						<span class="price" ng-if="order_items.cpns_name!='不使用优惠券'">-{{order_items.cpns_money | currency:'￥'}}</span>
					</div>
				</li>
				<li class="item yhItem" on-tap="openModal_express(storeIndex)" ng-if="order_items.shipping">
					配送方式<img src="./img/guilin/common/icon_right@2x.png" class="jt" />
					<div class="rightDiv">
						{{order_items.shipping_name}}
						<span class="price">{{order_items.shipping_money | currency:'￥'}}</span>
					</div>
				</li>
				<li class="item lyItem">
					<div class="row padding-0">
						<div class="tipCol">买家留言</div>
						<div class="col padding-0">
							<textarea placeholder="请输入留言信息" ng-model="order_items.memo" class="ly"></textarea>
						</div>
						<div class="closeCol item-image" on-tap="clearInput(1)">
							<img src="./img/guilin/common/icon_delete_g@2x.png" />
						</div>
					</div>
				</li>
				<li class="item everyTotalItem">
					共{{order_items.goods_count}}件商品&nbsp;&nbsp;小计：
					<span class="everyTotal">{{order_items.store_slip_subtotal|currency:'￥'}}</span>
				</li>				
			</div><!--最外层循环结束-->
			
			<div style="height: 105px;" ng-if="isApplyInvoice"></div>
			<div style="height: 85px;" ng-if="isApplyInvoice&&isPersonInvoice"></div>
			<div style="height: 45px;" ng-if="!isApplyInvoice"></div>
		</div>
	</ion-content>
	
	
	<div class="list footer">
		<li class="item lyItem ttItem" ng-if="isApplyInvoice" style="background: lightsalmon">
			<div class="row padding-0">
				<div class="tipCol">发票抬头</div>
				<div class="col padding-0">
					<textarea placeholder="请输入发票抬头" ng-model="input.tax_company" class="ly" style="height: 25px;"></textarea>
				</div>
				<div class="closeCol item-image" on-tap="clearInput(2)">
					<img src="./img/guilin/common/icon_delete_g@2x.png" />
				</div>
			</div>
			<!-- ng-if="!isPersonInvoice"-->
			<div class="shuihao" ng-if="!isPersonInvoice">企业税号&nbsp;&nbsp;{{check.vatinfo.tax_no}}</div>
		</li>
		<li class="item totalItem">
			可获积分:<span class="org">{{check.order_detail.totalGainScore}}</span>分
			<div class="submit"  on-tap="submit()">提交订单</div>
			<div class="total">合计:<span class="org">{{check.order_detail.total_amount|currency:'￥'}}</span></div>
		</li>
	</div>
</ion-view>